package com.rd.student.wulian.wanggaobo.day0731;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

public class RandomNum02 {
    public static void main(String[] args) {
        Set<Integer> randomSet = new HashSet<>();
        Random random = new Random();

        while (randomSet.size() < 20) {
            int number = random.nextInt(50);
            randomSet.add(number);
        }

        for (int num : randomSet) {
            System.out.println(num);
        }
    }
}